import 'dart:convert';

import 'package:get/get_connect/connect.dart';
import 'package:get_storage/get_storage.dart';

import '../init_context.dart';
class CassieRequest extends GetConnect {
  @override
  void onInit(){
    httpClient.baseUrl = "http://localhost:9999/admin/";
  }
}

class CassieAuthRequest extends CassieRequest {
  @override
  void onInit(){
    super.onInit();
    httpClient.addRequestModifier<void>((request) {
      final storage = GetStorage("user");
     String   access_token = storage.read("access_token");
      request.headers['access_token'] = access_token;
      return request;
    });
  }
}